;;; set-speedbar.el - settings for speedbar.
;;;  
;;; Copyright (C) 2011 Jeffy Du
;;;  
;;; Author: Jeffy Du (cmdxiaoha@163.com)
;;; Create: 2011-12-23 23:43:24
;;; Last Modified: 2011-12-23 23:43:49
;;;  
;;; History:
;;; --------
;;; 2011-12-23  v0.1  Jeffy Du (cmdxiaoha@163.com)
;;;     1. Initial revision.

(require 'sr-speedbar)

(defun my-speedbar-settings ()
  "Settings for speedbar."

  ;; Key bindings.
  (define-key global-map [(f9)] 'sr-speedbar-toggle)
  (define-key global-map "\C-xp" 'sr-speedbar-select-window)

  (setq speedbar-show-unknown-files t) ; show all files
  (setq speedbar-tag-hierarchy-method '(speedbar-simple-group-tag-hierarchy))
  (setq sr-speedbar-width 30) ; init window size
  (setq sr-speedbar-delete-windows t) ;delete other window on sr-speedbar startup
  (setq sr-speedbar-skip-other-window-p t)
  
  ;; Set auto raise mode.
  (add-hook 'speedbar-mode-hook (lambda ()
                                  (auto-raise-mode 1)))
)

(eval-after-load "speedbar"
  '(my-speedbar-settings))
